package com.xc.entity.query;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import lombok.Data;

import java.io.Serializable;

@Schema(title = "分页请求参数")
@Data
public class PageQuery implements Serializable {
    private static final long serialVersionUID = 1L;

    private static final Long DEFAULT_PAGE_NO = 1L;
    private static final Long DEFAULT_PAGE_SIZE = 10L;

    @Schema(title = "当前页")
    @Min(value = 1, message = "页码最低第一页")
    private Long pageNo = DEFAULT_PAGE_NO;

    @Schema(title = "每页数量")
    @Min(value = 1, message = "一页最低一条")
    private Long pageSize = DEFAULT_PAGE_SIZE;

    @Schema(title = "排序字段")
    private String sortCol;

    @Schema(title = "是否升序")
    private Boolean isAsc;
}
